<%@ page contentType="text/html;charset=UTF-8" %>﻿
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="com.saturn.titan.core.bean.BusiWorkBill" %>
<%@ page import="com.saturn.titan.web.utils.CRMUtil" %>
<%@ page import="com.saturn.titan.core.comm.CRMCache" %>
<%@ page import="com.saturn.titan.util.DateUtil" %>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="" name="description"/>
<meta content="" name="author"/>

<link rel="stylesheet" type="text/css" href="${ctx}/static/js/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/static/js/themes/IconExtension.css" />

</head>
<body style="background: #fff;"> 
<div style="padding:5px;background:#eee;">
	<a id="edit" href="javascript:;" class="easyui-linkbutton" plain="true" iconCls="icon-edit">修改</a>
	<a id="deploy" href="javascript:;" class="easyui-linkbutton" plain="true" iconCls="icon-20130410120031302_easyicon_net_16">分派</a>
	<a id="cancle" href="javascript:;" class="easyui-linkbutton" plain="true" iconCls="icon-Empty">作废</a>
	<a id="print" href="javascript:;" class="easyui-linkbutton" plain="true" iconCls="icon-2012081511202">打印</a>
</div>
<br/>

<form stype="display:none;" id="deployForm" action="${ctx}/deployBill/selectDeployEmp" method="POST">
<input type="hidden" readonly name="workBillId" value="${workbill.id}"  id="workBillId"></input>
<input type="hidden" value="${ctx}" id="context_val">
</form>

<form id="workBillForm" action="${ctx}/workBill/insert" method="POST">
<input type="hidden" readonly name="type" id="type" ></input>
<input type="hidden" readonly name="billId" id="billId" value="${workbill.id}" ></input>
<input type="hidden" readonly name="empId" id="empId" value="${currentEmpId}" ></input>
<input type="hidden" readonly name="account" id="account" value="${currentAccount}" ></input>

<div id="fb" class="easyui-panel" style="padding:10px;" title="基础信息" collapsible="true">
	<table cellpadding="5">
   		<tr>
   			<td>工单号:</td>
   			<td>${workbill.billNo}</td>
   			<td>状态:</td>
   			<td>
   				<select class="easyui-combobox" editable=false name="billStt" id="billStt" disabled>
   					<option ${workbill.billStt == 0?"selected='selected'":""} value="0">待分派(话务员)</option>
   					<option ${workbill.billStt == 1?"selected='selected'":""} value="1">待处理</option>
   					<option ${workbill.billStt == 2?"selected='selected'":""} value="2">待回访</option>
   					<option ${workbill.billStt == 3?"selected='selected'":""} value="3">已完成</option>
   					<option ${workbill.billStt == 4?"selected='selected'":""} value="4">退单</option>
   					<option ${workbill.billStt == 6?"selected='selected'":""} value="6">待分派(区域主管)</option>
   					<option ${workbill.billStt == 9?"selected='selected'":""} value="9">作废</option>
   				</select>
   			</td>
   			<td>要求开始日期:</td>
   			<td><input style="width:140px;" class="easyui-datebox" id="startDate" name="startDate"></input></td>
   			<td>实际开始日期:</td>
   			<td><input style="width:140px;" class="easyui-datebox" id="factStartDate" name="factStartDate"></input></td>
   			
   		</tr>
   		<tr>
   			<td>请求类型:</td>
   			<td>
   				<select class="easyui-combobox" editable=false name="requestType" disabled>
   					<option ${workbill.requestType == 0?"selected='selected'":""} value="0">维修</option>
   					<option ${workbill.requestType == 1?"selected='selected'":""} value="1">安装</option>
   					<option ${workbill.requestType == 2?"selected='selected'":""} value="2">投诉</option>
   				</select>
			</td>
   			<td>紧急度:</td>
   			<td>
   				<select value=1 class="easyui-combobox" editable=false name="emergentType" disabled>
   					<option ${workbill.emergentType == 0?"selected='selected'":""} value="0">不紧急</option>
   					<option ${workbill.emergentType == 1?"selected='selected'":""} value="1">一般</option>
   					<option ${workbill.emergentType == 2?"selected='selected'":""} value="2">紧急</option>
   				</select>
   			</td>
   			<td>要求结束日期:</td>
   			<td><input style="width:140px;" class="easyui-datebox" id="endDate" name="endDate"></input></td>
   			<td>实际结束日期:</td>
   			<td><input style="width:140px;" class="easyui-datebox" id="factEndDate" name="factEndDate"></input></td>
   			
   		</tr>
   		<tr>
   			<td>创建人:</td>
   			<td>
   			<% BusiWorkBill bill = (BusiWorkBill)request.getAttribute("workbill"); %>
   			<%=CRMCache.displayOpr(bill.getCrtOpr())%>
			</td>
   			<td>创建时间:</td>
   			<td>
   				<%=DateUtil.dateTime2String(bill.getCrtDate())%>
   			</td>
   			<td>当前派工人员:</td>
   			<td>${currentEmp}</td>
   			<td></td>
   			<td></td>
   		</tr>
   	</table>
</div>
<br/>
<div id="fc" class="easyui-panel" style="padding:10px;" title="客户信息" iconCls="icon-save" collapsible="true">
	<table cellpadding="5" width=100%>
   		<tr>
   			<td>来电时间:</td>
   			<td><input style="width:140px;" class="easyui-datetimebox" name="phoneTime" id=phoneTime ></input></td>
   			<td>区域:</td>
   			<td><select class="easyui-combobox" name="area"><option value="0">湖南</option></select></td></td>
   		</tr>
   		<tr>
   			<td>来电号码:</td>
   			<td>
   			<input style="width:140px;" value="${workbill.customerPhone}" class="easyui-textbox" type="text" name="phoneNo" data-options="required:true"></input>
   			<a href="#" class="easyui-linkbutton" iconCls="icon-search">历史来电</a>
   			</td>
   			<td>客户名称:</td>
   			<td>
   			<input style="width:123px;" value="${workbill.customerName}" class="easyui-textbox" type="text" name="customerId" data-options="required:true" ></input>
   			<a href="#" class="easyui-linkbutton" iconCls="icon-search">历史来电</a>
   			</td>
   		</tr>
   		<tr>
   			<td>客户地址:</td>
   			<td colspan=3>
   				<input class="easyui-textbox" type="text" size='125px' name="customerAddr" data-options="required:true" value="${workbill.customerAdd}" ></input>
   				<a href="#" class="easyui-linkbutton" iconCls="icon-search">历史来电</a>
   			</td>
   		</tr>
   	</table>
</div><br/>
<div id="fp" class="easyui-panel" width="100px;" style="float:left;padding:10px;" title="产品信息/问题描述" collapsible="true">
	<table cellpadding="5" width=100% >
   		<tr >
   			<td width="8%">产品编号:</td>
   			<td width="15%"><input class="easyui-textbox" type="text" name="itmNo" data-options="required:true"></input></td>
   			<td width="72%" rowspan=5><textarea name="issueDesc" style="width:95%;height:90%">问题描述....</textarea></td>
   		</tr>
   		<tr>
   			<td>品名:</td>
   			<td><input class="easyui-textbox" type="text" name="itmName" data-options="required:true"></input></td>
   		</tr>
   		<tr>
   			<td>规格:</td>
   			<td><input class="easyui-textbox" type="text" name="specification" data-options="required:true"></input></td>
   		</tr>
   		<tr>
   			<td>序列号</td>
   			<td><input class="easyui-textbox" type="text" name="seralNo" data-options="required:true"></input></td>
   		</tr>
   		<tr>
   			<td></td>
   			<td><a href="#" class="easyui-linkbutton" iconCls="icon-search">设备卡...</a></td>
   		</tr>
   	</table>
</div>
</form>
<br/>
<div id="tabs" class="easyui-tabs" border="true">
	<div title="派工历史记录" style="padding: 10px; overflow: hidden;">123</div>
	<div title="安装历史记录" style="padding: 10px; overflow: hidden;">123</div>
	<div title="维修历史记录" style="padding: 10px; overflow: hidden;">123</div>
</div>

<script type="text/javascript" src="${ctx}/static/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${ctx}/static/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/static/workbill/viewWorkBill.js"></script>
<script>
$(function(){
	$("#phoneTime").datebox("setValue","<fmt:formatDate value="${workbill.phoneTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate>");
	$("#startDate").datebox("setValue","<fmt:formatDate value="${workbill.startDate}" pattern="yyyy-MM-dd"></fmt:formatDate>");
	$("#endDate").datebox("setValue","<fmt:formatDate value="${workbill.endDate}" pattern="yyyy-MM-dd"></fmt:formatDate>");
	$("#factStartDate").datebox("setValue","<fmt:formatDate value="${workbill.factStartDate}" pattern="yyyy-MM-dd"></fmt:formatDate>");
	$("#factEndDate").datebox("setValue","<fmt:formatDate value="${workbill.factEndDate}" pattern="yyyy-MM-dd"></fmt:formatDate>");
})
</script>
	<div id="assign_area_dialog" class="easyui-dialog" style="padding:5px;width:500px;height:200px;"
        	title="区域派工" iconCls="icon-ok" close="true"  buttons="#assign-buttons"> 
	   		<form id="assign_area_form">
				<table >
					<tr>
						<td>区域：</td>
						<td>
							<select  class="easyui-combobox" name="assign_area" id="assign_area">
							</select>
						</td>
							<td>主管:</td>
						<td>
						<select  class="easyui-combobox" name="area_emp" id="area_emp">
								
						</select>
					</td>	
						
					</tr>
					
				</table>
				</form>
		</div> 
		<div id="assign-buttons">    
		    <a href="#" class="easyui-linkbutton" iconCls="icon-20130410120031302_easyicon_net_16" onclick="area_AssignHander();">分派</a>    
		    <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#assign_area_dialog').dialog('close')">取消</a>    
		</div>
		
		
			<div id="assign_manager_dialog" class="easyui-dialog" style="padding:5px;width:500px;height:200px;"
        	title="主管派工" iconCls="icon-ok" close="true"   buttons="#assign-manager-buttons"> 
	   		<form id="assign_manager_form">
				<table >
					<tr>
						<td>所属主管：</td>
						<td>
							<input type="text" id="manager_id">
						</td>
							<td>接单人:</td>
						<td>
						<select  class="easyui-combobox" name="managed_emp" id="managed_emp">
								
						</select>
					</td>	
						
					</tr>
					
				</table>
				</form>
		</div> 
		<div id="assign-manager-buttons">    
		    <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="manager_AssignHander();">分派</a>    
		    <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#assign_manager_dialog').dialog('close')">取消</a>    
		</div>
	
</body>
</html>